package mybatis.mappers;


import models.crawlers.common.SessionParams;
import models.crawlers.events.ProductProcessed;
import models.entities.CrawlerActionEntity;
import models.entities.CrawlerEntity;
import models.entities.CrawlerWarningEntity;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface CrawlerMapper {
    //int createNewSession(SessionParams sessionParams);

    void writeAction(CrawlerActionEntity crawlerAction);

    void writeWarning(CrawlerWarningEntity warning);

    void changeCategoryIndex(@Param("sessionId") int sessionId, @Param("categoryIndex") int categoryIndex);

    void changePageNumber(@Param("sessionId") int sessionId, @Param("pageNumber") int pageNumber);

    List<SessionParams> getSessions(@Param("crawlerTitle") String crawlerTitle);

    SessionParams getSession(@Param("sessionId") int sessionId);


    void setCrawlerPosition(ProductProcessed eventObject);

    void updateSession(SessionParams sessionParams);

    CrawlerEntity getCrawlerInfo(@Param("crawlerName") String crawlerName);

    void updateCrawlerInfo(CrawlerEntity crawlerInfo);

    List<CrawlerEntity> getAllCrawlers();

    void setProductCount(CrawlerEntity crawlerInfo);
}
